import requests
import pandas as pd

# 获取响应
url = 'http://news.sina.com.cn/zt_d/qswur2020/'
r = requests.get(url)
r.encoding = r.apparent_encoding
html = r.text

# 解析网页
a = pd.read_html(html)
df = pd.concat(a)

# 保存数据
df.to_csv('./世界大学QS排名3.csv',index=False,encoding='utf-8')
print('写入成功')